path=$1
echo "usage eg: ./sort.sh nba_test/"

sort -u $1/wav.scp > $1/wave.scp
rm $1/wav.scp
mv $1/wave.scp $1/wav.scp

sort -u $1/utt2spk > $1/utt
rm $1/utt2spk
mv $1/utt $1/utt2spk

utt2spk_to_spk2utt.pl $1/utt2spk > $1/spk2utt

sort -u $1/text > $1/txt
rm $1/text
mv $1/txt $1/text
sort -u $1/segments > $1/seg
rm $1/segments
mv $1/seg $1/segments